package org;

import java.awt.Graphics;
import java.awt.image.BufferedImage;
import java.io.InputStream;

import javax.imageio.ImageIO;
import javax.swing.JPanel;

@SuppressWarnings("serial")
public class ImagePanel extends JPanel {
	private BufferedImage image;
	private String imageFullName;
	
	public ImagePanel() {
		try {
			InputStream is = this.getClass()
									.getClassLoader()
										.getResourceAsStream( "jeff.jpg" );
			image = ImageIO.read( is );
		} catch (Exception e) {
			// Log: Cant read image
			System.out.println("Cant Read Image: " + getImageFullName());
		}

	}
	
	@Override
	public void paintComponent(Graphics g) {
		g.drawImage(image, 0, 0, null);
	}

	public String getImageFullName() {
		return imageFullName;
	}

	public void setImageFullName(String imageFullName) {
		this.imageFullName = imageFullName;
	}
}